
import pandas as pd

 
df = pd.read_excel("/Users/feidao/Documents/管理小组文件/中海四期数据0627-2.xlsx", engine="openpyxl")
# print(df)
# print(df['工时'])

# 总工时
total = (df['工时'].sum()) / 8
print("实际总工时：%s人天, 计划工时: %s人天" % (total,"?"))

# 各端工时
dept_total =  (df.groupby(['一级任务类型'])['工时'].sum())/8
print(dept_total)

# people工时
# sub_total =  df.groupby(['责任人'])['工时'].sum()
# print(sub_total)


# 收费工时

# 非收费工时

# 测试工时 研测比 = 测试 / 总工时
test_total = (df[df['一级任务类型'].str.contains('测试')]['工时'].sum())/8
print("测试工时（仅测试部门）：%s" % test_total)


# 产品设计和项目管理占比
project_total = (df[df['二级任务类型'].str.contains('(?:需求|项目|产品｜发布).*',regex=True)]['工时'].sum())/8
print("产品设计及项目管理工时：%s" % project_total)

# 开发时间
dev_total = df[df['二级任务类型'].str.contains('(?:方案|开发).*',regex=True)]['工时'].sum()/8
print("开发时间（方案+开发）：%s" % dev_total)

dev_text_rate = (test_all_total / dev_total)
print("研测比：%s" % dev_text_rate)



# total = (df['工时'].sum())/ 8
# print("项目总工时：" % total)
